<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>广告联调平台</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link href="../layui/css/layui.css" rel="stylesheet">
</head>
<body>
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo layui-hide-xs layui-bg-black">广告联调平台</div>
    <!-- 头部区域（可配合layui 已有的水平导航） -->
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item layui-hide layui-show-sm-inline-block">
        <a>
          <img src="../img/yonghu.png" class="layui-nav-img">
          <span id="uName"></span>
        </a>
        <dl class="layui-nav-child">
          <dd><a lay-on="confirm">退出登录</a></dd>
        </dl>
      </li>
    </ul>
  </div>
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree" lay-filter="test">
        <li class="layui-nav-item layui-nav-itemed"><a href="../admin.html">首页</a></li>
        <li class="layui-nav-item">
          <a class="" href="javascript:;">oppo</a>
          <dl class="layui-nav-child">
            <dd><a href="oppoIndex.html">数据汇总</a></dd>
            <dd><a href="../admin.html">数据明细</a></dd>
            <dd><a href="../admin.html">链接管理</a></dd>
            <dd><a href="create.html">链接创建</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item">
          <a class="" href="javascript:;">优酷</a>
          <dl class="layui-nav-child">
              <dd><a href="../youku/selecteff.html">有效触点监测地址</a></dd>   
              <dd><a href="../youku/effpoint.html">有效触点链接</a></dd>
              <dd><a href="../youku/selectadinfo.html">联调触点列表</a></dd>
              <dd><a href="../youku/xianyuinfo.html">闲鱼触点列表</a></dd>    
          </dl>
        </li>
        <li class="layui-nav-item">
          <a class="" href="javascript:;">淘宝</a>
          <dl class="layui-nav-child">
              <dd><a href="../taobao/deeplinkTb.html">deeplink转换工具</a></dd>
          </dl>
        </li>
        <li class="layui-nav-item"><a href="../admin.html">完善信息</a></li>
      </ul>
    </div>
  </div>
  <div class="layui-body">
    <!-- 内容主体区域 -->
    <div style="padding: 15px;">
      <blockquote class="layui-elem-quote layui-text">
        数据汇总
      </blockquote>
      <div class="layui-row layui-col-space15">
        <div class="layui-col-md5">
          <div class="grid-demo grid-demo-bg1">
            <div class="layui-card layui-panel" style="background-color: #C7EDCC;">
              <div class="layui-card-header">
                汇总信息
              </div>
              <div class="layui-card-body">
                总访问次数：<span id="allVisit"></span><br>总转化次数：<span id="allTransform"></span><br>转化率：<span id="allRate"></span>
              </div>
            </div>
          </div>
        </div>
        <div class="layui-col-md5">
          <div class="grid-demo">
            <div class="layui-card layui-panel" style="background-color: #DCE2F1;">
              <div class="layui-card-header">
                今日信息
              </div>
              <div class="layui-card-body">
                今日访问次数：<span id="todayVisit"></span><br>今日转化次数：<span id="todayTransform"></span><br>今日转化率：<span id="todayRate"></span>
              </div>
            </div>
          </div>
        </div>
        <div class="layui-col-md5">
          <div class="grid-demo">
            <div class="layui-card layui-panel" style="background-color: #E9EBFE;">
              <div class="layui-card-header">
                近小时信息
              </div>
              <div class="layui-card-body">
                近小时访问次数：<span id="lastVisit"></span><br>近小时转化次数：<span id="lastTransform"></span><br>近小时转化率：<span id="lastRate"></span>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
  <div class="layui-footer" style="text-align: center;">
    <!-- 底部固定区域 -->
    冀ICP备2025105329号
  </div>
</div>

<script src="../layui/layui.js"></script>
<script src="../layui/echarts.min.js"></script>
<script>
  //JS
  layui.use(['element', 'layer', 'util'], function(){
    var layer = layui.layer;
    var util = layui.util;
    var $ = layui.$;
    var query = layui.jquery;
    var userInfo = {};

    window.onload = function() {
      query.ajax({
        type:"POST",
        url:"/user/queryUser",
        success:function(result){
          if (result.success === true) {
            userInfo = result.user;
            $('#uName').text(userInfo.mobileNo);
          } else {
            layer.alert('获取用户信息失败，请重新登录！', {
              title: '发生错误'
            });
            setTimeout(function(){
              window.location.href = "/";
            }, 1500)
          }
        },
        error:function(){
          layer.alert('访问链接不存在！', {
            title: '发生错误'
          });
        }
      });

    };


    util.on('lay-on',{
      confirm: function() {
        layer.confirm('是否退出登录？', {
          btn: ['确定']
        }, function(){
          query.ajax({
            type:"GET",
            url:"/user/logout",
            success:function(result){
              if (result.success === true) {
                layer.msg(result.msg, { icon:1 });
                setTimeout(function(){
                  window.location.href = "/";
                }, 1500)
              } else {
                layer.msg(result.msg, { icon:2 });
              }
            },
            error:function(){
              layer.alert('访问链接不存在！', {
                title: '发生错误'
              });
            }
          })
        })
      }
    })

  });
</script>

</body>
</html>